package com.kk.base.entity.home;

/**
 * 付款方式枚举
 */
public enum PaymentMethodEnum {

    SPOTPAYMENT(0,"现付"),
    FREIGHTCOLLECTPAYMENT(1,"到付");


    private Integer code;
    private String name;

    PaymentMethodEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getByCode(int code){
        for (PaymentMethodEnum value : PaymentMethodEnum.values()){
            if (code == value.getCode()){
                return value.getName();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
